package com.showde.shoppingmall.activity;

import com.showde.shoppingmall.R;
import com.showde.shoppingmall.ShoppingMallApplication;
import com.showde.shoppingmall.utils.ActivityDispatch;

import android.view.View;
import android.widget.TextView;

public class UserInfoActivity extends BaseActivity {

	private TextView userAccount;
	private TextView userNum;
	private TextView modifyPassword;

	@Override
	public void onClick(View v) {

	}

	@Override
	protected void initParam() {
		if (!ShoppingMallApplication.userSession.isSessionAvailable()) {
			// ToastUtils.showToast(this, "请登录吉鸿商城...");
			ActivityDispatch.openNewActivity(this, LoginActivity.class,
					ActivityDispatch.getActivityGroup(groupTag),
					"ProductDetailsActivity", groupTag);
			return;
		}
	}

	@Override
	protected void initView() {
		setContentView(R.layout.activity_userinfo);

		userAccount = (TextView) findViewById(R.id.txt_userAccount);
		userNum = (TextView) findViewById(R.id.txt_usernum);
		modifyPassword = (TextView) findViewById(R.id.txt_password_modify);
		modifyPassword.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				ActivityDispatch.toModifyPassword(getApplication());
			}
		});

		userAccount.setText("你好，"
				+ ShoppingMallApplication.userSession.getSessionUser()
						.getUserAccount());
		userNum.setText("账号："
				+ ShoppingMallApplication.userSession.getSessionUser()
						.getUserID());
	}

}
